<?php
namespace app\web\validate;

use think\Validate;


class CombineValidate extends Validate {

    /**
     * 字段验证规则
     *
     * @var array
     */
    protected $rule = [
        'id|组合下单ID'  => 'require',
        'project_id|项目ID'  => 'require',
        'name|名称' => 'require|max:100',
        'block_type|上钟类型' => 'require',
        'room_type|房间类型' => 'require',
        'sort|排序' => 'number',
        'store_id|门店ID' => 'number',
    ];


    /**
     * 字段验证规则提示
     *
     * @var array
     */
    protected $message  =   [
        'id.require' => '项目ID必填',
        'project_id.require' => '项目ID必填',
        'name.require' => '名称必填',
        'name.max'     => '名称最多不能超过100个字符',
        'block_type.require'   => '上钟类型必填',
        'room_type.require'   => '房间类型必填',
        'sort.number'   => '排序必须是数字',
        'store_id.number'   => '门店ID必须是数字',
    ];


    protected $scene = [
        'add'=>['project_id','name','block_type','room_type','sort','store_id'],
        'edit'=>['id','project_id','name','block_type','room_type','sort','store_id'],
    ];




}